home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Collection of Tools & Utilities
/
Collection of Tools and Utilities.iso
/
batchut
/
tsbat45.zip
/
GFIND.BAT
< prev
next >
Wrap
DOS Batch File
|
1993-04-13
|
3KB
|
100 lines
@echo off
rem A trivial MsDos batch to find files from the Garbo indexes
rem
rem Some users have wished that Garbo would have an index like SIMTEL20
rem giving the directory, filesize, and file information. You can use
rem this quick and dirty batch to get information in that format.
echo ┌─────────────────────────────────────────────────┐
echo │ Find files from the Garbo indexes │
echo │ By Prof. Timo Salmi, ts@uwasa.fi, Tue 13-Apr-93 │
echo └─────────────────────────────────────────────────┘
if "%1"=="" goto _help
rem ┌─────────────────────────────────────────────────────────────┐
rem │ Edit here where you have your own corresponding index files │
rem └─────────────────────────────────────────────────────────────┘
set ind1_=d:\_file.lst
set ind2_=d:\_dir.lst
set ind3_=c:\chyde\index
if exist %ind1_% goto _2
echo File %ind1_% not found
goto _out
:_2
if exist %ind1_% goto _3
echo File %ind1_% not found
goto _out
:_3
if exist %ind1_% goto _4
echo File %ind1_% not found
goto _out
:_4
rem Check that MsDos find.exe is available at path or current directory
set found_=no
if exist find.exe set found_=yes
for %%d in (%path%) do if exist %%dfind.exe set found_=yes
for %%d in (%path%) do if exist %%d\find.exe set found_=yes
if "%found_%"=="yes" goto _5
echo MsDos file find.exe not found at path or current directory
goto _out
:_5
rem Check if grep.com is available at path or current directory
rem Else use MsDos find.exe
set found_=no
if exist grep.com set found_=yes
for %%d in (%path%) do if exist %%dgrep.com set found_=yes
for %%d in (%path%) do if exist %%d\grep.com set found_=yes
if not "%found_%"=="yes" goto _usefind
rem Find the information with grep.com
grep %1 %ind1_%> garbo$$$
grep %1 %ind2_%>> garbo$$$
grep ^%1 %ind3_%>> garbo$$$
find "%1" garbo$$$
goto _out
:_usefind
rem Find the information with MsDos find.exe
find "%1" %ind1_%> garbo$$$
find "%1" %ind2_%>> garbo$$$
find "%1" %ind3_%>> garbo$$$
find "%1" garbo$$$
goto _out
:_help
echo.
echo This is a highly specialized batch for combining the information
echo from Garbo MsDos FTP archives file index files INDEX.ZIP, _dir.zip
echo and _file.zip.
echo.
echo Usage: GFIND [filename]
echo.
echo The end of the file name need not be complete, only the beginning.
echo Example:
echo GFIND tsutil #This is ok
echo GFIND sutil37 #This will match only partially, but gets you going
echo.
echo The batch uses GREP.COM if you have such a utility. If you don't the
echo the ordinary MsDos FIND.EXE is used instead, but then then the
echo filename is matched from anywhere of the INDEX file lines.
echo.
echo GFIND is also available in Unix format as garbo.uwasa.fi:/unix/ts/gfind
echo.
echo Before using the first time, make the ind*_ environment variables in
echo the batch to point to where you have the relevant file index files.
goto _out
:_out
if exist garbo$$$ del garbo$$$
set ind1_=
set ind2_=
set ind3_=
set found_=